Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed unsupported variant type: 1024 (QJSValue) #140

Open
wants to merge 3 commits into
base: v1
Choose a base branch
from

Conversation

obscuren
Copy link

Added proper casting from QMetaType::User (1024) with userType 1034 (i.e.,
QJSValue) to QVariant so it can be handled properly by the packDataValue
method.

Added proper casting from QMetaType::User (1024) with userType 1034 (i.e.,
QJSValue) to QVariant so it can be handled properly by the packDataValue
method.
@pjoe
Copy link

pjoe commented Jan 24, 2015

I tried this with limetext/qml .. however for me the userType is 1051 ... will try a way to not hardcode this

@pjoe
Copy link

pjoe commented Jan 24, 2015

Here is what i ended up with, which seems to work:

diff --git a/cpp/capi.cpp b/cpp/capi.cpp
index 55ac585..c2255aa 100644
--- a/cpp/capi.cpp
+++ b/cpp/capi.cpp
@@ -745,7 +745,8 @@ void packDataValue(QVariant_ *var, DataValue *value)
         break;
     case QMetaType::User:
         {
-            if (qvar->userType() == 1034) {
+            static const int qjstype = QVariant::fromValue(QJSValue()).userType();
+            if (qvar->userType() == qjstype) {
                 auto var = qvar->value<QJSValue>().toVariant();
                 packDataValue(&var, value);
             }

@obscuren
Copy link
Author

Confirmed. @pjoe change works. Updated PR.

Program called "Moom" (http://manytricks.com/moom/) which uses OS X's
accesibility API could cause a crash with calling the log handler with a
null file in context.
@niemeyer
Copy link
Contributor

niemeyer commented Feb 9, 2015

We need a test case exercising the issue to make sure we understand the problem and it doesn't not regress.

Also, can you please sign the agreement so we can get the change in:

http://www.ubuntu.com/legal/contributors

@tgerring
Copy link

I don't think it was c288002 was intended to be part of the original PR, but it may be obsoleted by 154c0d1 which was merged in 2ee7e5f

@immesys
Copy link

immesys commented Apr 14, 2016

@Niemyer, please can you merge this in. It's really useful.

zoli added a commit to limetext/lime-qml that referenced this pull request Apr 24, 2016
using github.com/limetext/qml-go instead of gopkg.in/qml.v1 which
it seems its not under development anymore.
also applyed go-qml/qml#140 closes #4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants